<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
<head>
<title>#{bundle.paineleditar}</title>
<link type="text/css" href="#{facesContext.externalContext.requestContextPath}/style/style.css" 
	rel="stylesheet" />
<script type="text/javascript" 
	src="#{facesContext.externalContext.requestContextPath}/scripts/script.js">
</script>
</head>
<body>
	<div>
		<rich:modalPanel id="panelTur" width="600" height="420">
				<f:facet name="header">
					<h:panelGroup>
						<h:outputText value="#{bundle.paineledicao}"></h:outputText>
					</h:panelGroup>
				</f:facet>
				<f:facet name="controls">
					<h:panelGroup>
						<h:outputLink value="#" id="hidelink">#{bundle.sair}</h:outputLink>
						<rich:componentControl for="panelTur" attachTo="hidelink"
							operation="hide" event="onclick" />
					</h:panelGroup>
				</f:facet>
		<rich:tabPanel>
			<rich:tab label="#{bundle.paineleditaturma}">
				<div>
					<h:form id="formeturma">
						<h3>
							<h:outputText id="numTur" value="#{bundle.painelnumero}: #{eTurmaBean.numero}" />
						</h3>
						#{bundle.painelcap}
						<br />
						<h:inputText required="true" id="capTur" value="#{eTurmaBean.capacidade}">
							<f:validateLongRange minimum="1" />							
						</h:inputText>
						<rich:message for="capTur" style="color: blue;font-weight: bold;margin-left: 10px;" />						
						<br />
						#{bundle.painelturno}<br />
						<h:selectOneMenu id="turnoTur" value="#{eTurmaBean.turno }">
							<f:selectItem itemLabel="Manhã" itemValue="Manhã" />
							<f:selectItem itemLabel="Tarde" itemValue="Tarde" />
							<f:selectItem itemLabel="Noite" itemValue="Noite" />
						</h:selectOneMenu>
						<br />
						#{bundle.painelinicio}<br />
						<rich:calendar id="dITur" value="#{eTurmaBean.dataInicio}" required="true"
							datePattern="dd/MM/yyyy" enableManualInput="true" binding="#{dataIni}" />
						<rich:message for="dITur" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
						#{bundle.paineltermino}<br />
						<rich:calendar id="dFTur" value="#{eTurmaBean.dataFim}" required="true"
							datePattern="dd/MM/yyyy" enableManualInput="true" >
							<f:validator validatorId="dataValidator" />
							<f:attribute name="dataI" value="#{dataIni}" />
						</rich:calendar>
						<rich:message for="dFTur" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
						#{bundle.painelnomeprof}<br />
						<h:selectOneMenu id="profTur" value="#{eTurmaBean.professor }">
							<f:selectItems value="#{eTurmaBean.professores }" />
						</h:selectOneMenu>
						<br />
						#{bundle.painelnomecurso}<br />
						<h:selectOneMenu id="cursoTur" value="#{eTurmaBean.curso }">
							<f:selectItems value="#{eTurmaBean.cursos }" />
						</h:selectOneMenu>
						<br />
						#{bundle.paineleditturmaaluno}<br />
						<h:selectOneMenu id="aluTur" value="#{eTurmaBean.aluno }">
							<f:selectItems value="#{eTurmaBean.alunos }" />
						</h:selectOneMenu>
						<a4j:commandButton value="#{bundle.paineleditturmaremoveraluno}" id="RemAlu" reRender="aluTur"
							action="#{eTurmaBean.removeAluno}" onclick="return confirm('#{bundle.paineleditturmaoconfirmexcluiraluno}');">
						</a4j:commandButton>
						<br />
						<br />
						<a4j:commandButton value="#{bundle.painelatualizar}" id="HideTur" reRender="dtpantur"
							action="#{eTurmaBean.atualizar}" oncomplete="windowclose('editturma:formeturma:errorMsgsTur','panelTur')">
						</a4j:commandButton>
						<br/>
						<a4j:outputPanel ajaxRendered="true">
                    		<h:messages id="errorMsgsTur" style="display:none"></h:messages>
               			</a4j:outputPanel>						  
					</h:form>
				</div>
			</rich:tab>
		</rich:tabPanel>
		</rich:modalPanel>
	</div>
</body>
</html>